<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="theme-color" content="#000000">
  <meta http-equiv="Pragma" content="no-cache">
  <meta http-equiv="Cache-Control" content="no-cache">
  <meta http-equiv="Expires" content="0">
  <!--
      manifest.json provides metadata used when your web app is added to the
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
    -->
  <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
  <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
  <link rel="stylesheet" href="//at.alicdn.com/t/font_617853_k3gvejo96fb.css">
  <!--
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
  <title>UES</title>
</head>

<body>
  <noscript>
    You need to enable JavaScript to run this app.
  </noscript>
  <div id="root"></div>

  <a id="easemobimBtn" style="position:fixed; bottom: 12px; right: 12px; display: block; width: 120px; height: 44px; background: #d4a668; color: #fff; font-size: 16px; z-index: 99; text-align: center; line-height: 44px; border-radius: 20px; text-decoration: none"
    href='javascript:;'>联系客服</a>
  <script src='//kefu.easemob.com/webim/easemob.js'></script>
  <script>
    window.easemobim = window.easemobim || {};
    easemobim.config = {
      hide: true,
      autoConnect: true,
    };
    function getAccount() {
      const account = sessionStorage.getItem('account');
      try {
        return JSON.parse(account);
      } catch (error) { }
      return false;
    }
    document.getElementById("easemobimBtn").addEventListener('click', function () {
      const config = { configId: "94ae9cb3-d884-4824-9398-f42bf6bca240" };
      const account = getAccount();
      if (account) {
        const { csUsername, csPass, isRegisteredCs } = account;
        if (isRegisteredCs === "1") {
          config.user = {
            username: csUsername,
            password: csPass
          }
        }
      }
      easemobim.bind(config);
    }, false);
  </script>
</body>

</html>